<header class="layout head padding-small">
    <a href="javascript:pageBack();" class="hBack float-left"></a>
    <h4 class="hTxt float-left text-center text-white">秒杀专区</h4>
    <a href="javascript:;" id="btnJdkey" class="hHlep float-right"></a>
</header>

<div class="layout"><img class="good-img" src="<?php echo TEMPLATES_PATH; ?>/images2/msq.jpg"></div>

<!----------------秒杀产品------------------->
<?php if(is_array($output['goods_list'][1])&&count($output['goods_list'][1])>0){?>
<div class="layout padding-small-top padding-small-bottom">
    <div class="tilte bg-white">
        <h4 class="text-white"><em>正在秒杀</em></h4>
    </div>
    <div class="container">
        <div class="line-small">
           <?php foreach($output['goods_list'][1] as $i=>$j){?>
            <div class="x6 margin-small-top ">
                <ul class="list-unstyle padding-small radius-big bg-white clearfix ">
                    <li><a href="<?php echo ncUrl(array('act' => 'goods', 'goods_id' => $j['goods_id']), 'goods'); ?>"><img class="img-responsive self-motion" src="<?php echo thumb($j, 'small'); ?>" onload="imgheqw(this)"></a></li>
                    <li class="ycyc"><a href="<?php echo ncUrl(array('act' => 'goods', 'goods_id' => $j['goods_id']), 'goods'); ?>"><?php echo $j['goods_name'] ?></a></li>
                    <li class="text-little zt_color">活动进行时，距离结束还有:</li>
                    <li class="text-little zt_color u-time" endtime="<?php echo $j['miaosha_endtime']; ?>">
                            <span class="ms_day"></span><span class="ms_hour"></span><span class="ms_min"></span><span class="ms_ms"></span>
                    </li>
                    <li class="text-small">秒杀价：<?php
                        if ($_SESSION['is_login'] == '1') {echo $j['miaosha_price'];} else {echo '<a href="index.php?act=login">请登录</a>';							}?>
                    </li>
                    <li class="button-small button border-red-light radius-rounded float-right"><a href="<?php echo ncUrl(array('act' => 'goods', 'goods_id' => $j['goods_id']), 'goods'); ?>">立即秒杀</a></li>
                </ul>
            </div>
            <?php   }?>
        </div>
    </div>
</div>
<?php }?>
<!----------------//秒杀产品------------------->

<!----------------秒杀预告------------------->
<?php if(is_array($output['goods_list'][2])&&count($output['goods_list'][2])>0){
foreach($output['goods_list'][2] as $k=>$v){?>
<div class="layout padding-small-top paaing-small-bottom">
    <div class="tilte bg-white">
        <h4 class="text-white"><em><?php echo $k;?>预告</em></h4>
    </div>

    <div class="container">
        <div class="line-small">
            <?php foreach($v as $i=>$j){?>
            <div class="x6 margin-small-top">
                <ul class="list-unstyle padding-small radius-big bg-white clearfix ">
                    <li><a href="<?php echo ncUrl(array('act' => 'goods', 'goods_id' => $j['goods_id']), 'goods'); ?>"><img class="img-responsive self-motion" src="<?php echo thumb($j, 'small'); ?>" onload="imgheqw(this)"></a></li>
                    <li class="ycyc"><a href="<?php echo ncUrl(array('act' => 'goods', 'goods_id' => $j['goods_id']), 'goods'); ?>"><?php echo $j['goods_name'] ?></a></li>
                    <li class="text-little zt_color">，活动没开始，距离开始时间:</li>
                    <li class="text-little zt_color u-time" endtime="<?php echo  $j['miaosha_starttime']; ?>"><span class="ms_day"></span><span class="ms_hour"></span><span class="ms_min"></span><span class="ms_ms"></span>
                    </li>
                    <li class="text-small">秒杀价：<?php
                        if ($_SESSION['is_login'] == '1') {echo $j['miaosha_price'];} else {echo '<a href="index.php?act=login">请登录</a>';							}?></li>
                    <li class="button-small bg-yellow-light border-red-light radius-rounded float-right"><a href="<?php echo ncUrl(array('act' => 'goods', 'goods_id' => $j['goods_id']), 'goods'); ?>">未开启</a></li>
                </ul>
            </div>
            <?php }?>
        </div>

    </div>
</div>
<?php }}?>
<!----------------//秒杀预告------------------->

<!----------------秒杀结束------------------->
<?php if(is_array($output['goods_list'][3])&&count($output['goods_list'][3])>0){?>
<div class="layout padding-small-top paaing-small-bottom">
    <div class="tilte bg-white">
        <h4 class="text-white"><em>秒杀结束</em></h4>
    </div>
    <div class="container">
        <div class="line-small">
            <?php foreach($output['goods_list'][3] as $i=>$j){?>
            <div class="x6 margin-small-top">
                <ul class="list-unstyle padding-small radius-big bg-white clearfix ">
                    <li><a href="<?php echo ncUrl(array('act' => 'goods', 'goods_id' => $j['goods_id']), 'goods'); ?>"><img class="img-responsive self-motion" src="<?php echo thumb($j, 'small'); ?>" onload="imgheqw(this)"></a></li>
                    <li class="ycyc"><a href="<?php echo ncUrl(array('act' => 'goods', 'goods_id' => $j['goods_id']), 'goods'); ?>"><?php echo $j['goods_name'] ?></a></li>
                    <li class="text-little zt_color">活动已结束，期待下一期</li>

                    <li class="text-small">秒杀价：<?php
                        if ($_SESSION['is_login'] == '1') {echo $j['miaosha_price'];} else {echo '<a href="index.php?act=login">请登录</a>';							}?></li>
                    <li class="button-small border-red-light radius-rounded float-right  bg-gray"><a href="<?php echo ncUrl(array('act' => 'goods', 'goods_id' => $j['goods_id']), 'goods'); ?>">已结束</a></li>
                </ul>
            </div>
            <?php }?>
        </div>
    </div>
</div>
<?php }?>
<!----------------//秒杀结束------------------->
<script type="text/javascript">/*倒计时*/
function downtime() {
	var date = new Date();
	var time = date.getTime() / 1000; //毫秒数
	$(".u-time").each(function(i) {
		var endTime = this.getAttribute("endTime");
		var lag = (endTime - time); //当前时间和结束时间之间的秒数
		if (lag > 0) {
			var second = Math.floor(lag % 60);
			var minite = Math.floor((lag / 60) % 60);
			var hour = Math.floor((lag / 3600) % 24);
			var day = Math.floor((lag / 3600) / 24);
			$(this).html("<span class=\"ms_day\">" + day + " 天</span><span class=\"ms_hour\">" + hour + " 小时</span><span class=\"ms_min\">" + minite + "</span><span class=\"ms_mao\">：</span><span class=\"ms_ms\">" + second + "</span>");
		}
	});
	setTimeout("downtime()", 1000);
}
$(document).ready(function() {
	downtime();
    //商品名称过长时的处理
    deal_words($('.ycyc a'));
});</script>